]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Properly disconnect from the state-changed signal
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 26 Apr 2013 04:25:14 +0000 (00:25 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 26 Apr 2013 16:16:05 +0000 (12:16 -0400)
The destroy signal never gets emitted, so we need to properly
disconnect manually when we destroy the wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=698918

js/ui/status/network.js

index 534c0ea374aca468fcdd9ffdb7e48a0df1f5ee1a..f4ff9196b9ea2f46726161dd84d0f6d9a7ec1af5 100644 (file)
@@ -1916,11 +1916,6 @@ const NMApplet = new Lang.Class({
         wrapper._deviceStateChangedId = wrapper.connect('state-changed', Lang.bind(this, function(dev) {
             this._syncSectionTitle(dev.category);
         }));
-        wrapper._destroyId = wrapper.connect('destroy', function(wrapper) {
-            wrapper.disconnect(wrapper._activationFailedId);
-            wrapper.disconnect(wrapper._deviceStateChangedId);
-            wrapper.disconnect(wrapper._destroyId);
-        });
 
         let section = this._devices[wrapper.category].section;
         section.addMenuItem(wrapper.statusItem);
@@ -1952,6 +1947,8 @@ const NMApplet = new Lang.Class({
     },
 
     _removeDeviceWrapper: function(wrapper) {
+        wrapper.disconnect(wrapper._activationFailedId);
+        wrapper.disconnect(wrapper._deviceStateChangedId);
         wrapper.destroy();
 
         let devices = this._devices[wrapper.category].devices;